//
//  MBLookForPasswordLastController.m
//  MiBaoTu
//
//  Created by 彭鹏 on 16/9/22.
//  Copyright © 2016年 com.caesartech15. All rights reserved.
//

#import "MBLookForPasswordLastController.h"
#import "MBLoginController.h"
#import "MBNavController.h"
@interface MBLookForPasswordLastController ()
@property (weak, nonatomic) IBOutlet UIButton *loginRightnow;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *btRight;

@end

@implementation MBLookForPasswordLastController

- (IBAction)loginRightnow:(id)sender {
    
    for (UIViewController *controller in self.navigationController.viewControllers) {
        if ([controller isKindOfClass:[MBLoginController class]]) {
            [self.navigationController popToViewController:controller animated:YES];
        }
    }
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"找回密码";
    self.view.backgroundColor = [UIColor whiteColor];
    self.loginRightnow.layer.cornerRadius = 5.0;
    self.loginRightnow.clipsToBounds = YES;
    [self setupNavBar];
    
    if (ISIPAD) {
        _btRight.constant = (SCREEN_WIDTH-700*PERCEN*(self.orientation==UIDeviceOrientationPortrait?1.0*SCREEN_WIDTH/SCREEN_HEIGHT:1.))/2.;;
    }
}

- (void)setupNavBar {
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"fanhui"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]style:UIBarButtonItemStylePlain target:self action:@selector(navigationBackButton)];
    
}

- (void)onUpdateUIForView:(UIDeviceOrientation)orientation
{
    if (ISIPAD) {
        _btRight.constant = (SCREEN_WIDTH-700*PERCEN*(self.orientation==UIDeviceOrientationPortrait?1.0*SCREEN_WIDTH/SCREEN_HEIGHT:1.))/2.;;
    }
}

//返回
-(void)navigationBackButton {
    [self.navigationController popViewControllerAnimated:YES];
}

@end
